package cn.edu.scau.cmi.zhangjunming.composite.safe;

import java.util.HashSet;
import java.util.Set;

public class SafeComposite extends SafeComponent {

	private String name;
	private Set<SafeComponent> children = new HashSet<SafeComponent>();
	
	public SafeComposite(){
        type = 0;
	}
	
	public String doSomething() {
		return "我是安全性组合模式中的组合组件";
	}
	
	public SafeComponent getParent() {
		
		return this.getParent();
	}
	
	public void setParent(SafeComponent parent) {
		this.parent = parent;
	}
	
	public SafeComponent addChildren(SafeComponent child) {
		children.add(child);
		return this;
	}
	
	public SafeComponent removeChildren(SafeComponent child) {
		children.remove(child);
		return this;
	}
	
	public void setName(String s) {
		name = s;
	}
	
	public String getName() {
		return name;
	}
	
	public Set<SafeComponent> getChildren(){
		return children;
	}
	
	public void SetChildren(Set<SafeComponent> children) {
		this.children  =  children;
	}
	
}
